package com.ocom.payconfig.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ocom.common.entity.payconfig.EntityDishesFoodstuff;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IDaoDishesFoodstuff extends BaseMapper<EntityDishesFoodstuff> {

    @Select({"<script>",
            "select   D.* , C.food_class_name , F.foodstuff_name " +
                    "from    dishes_foodstuff as D \n" +
                    "left join   foodstuff_info as F    on   F.foodstuff_id = D.foodstuff_id \n" +
                    "left join   foodstuff_class as C    on   C.food_class_id = F.food_class_id \n" +
                    "where  D.com_id =#{comId} and D.merch_id = #{merchId} and   D.dishes_id =#{dishesId} \n" +
                    "  order by   C.food_class_name , F.foodstuff_name " +
                    "</script>"})
    List<EntityDishesFoodstuff> getList(@Param("comId")Long comId,
                                        @Param("merchId")Integer merchId,
                                        @Param("dishesId")Integer dishesId);
}
